package org.flashIso.engine.core {
	import flash.events.Event;
	
	import org.flashIso.engine.events.IsoEvent;

	/**
	 * @author Marius Dorin Moraru
	 */
	public class FillDescriptor extends ValidateableObject {
		private var _drawFill : Boolean = true;
		private var _color : uint = 0x000000;
		private var _alpha : Number = 0.2;
		private var _drawLine : Boolean = true;
		private var _lineThickness : uint = 1;
		private var _lineColor : uint = 0.000000;
		private var _lineAlpha : Number = 0.5;
		private var _pointsList : Point3DList = new Point3DList();

		public function FillDescriptor() {
			super();
			//_pointsList.change.add(addToValidateQue);
			_pointsList.addEventListener(Event.CHANGE, triggerValidation, false, 0, true);
		}

		public function set drawFill(value : Boolean) : void {
			if (_drawFill != value) {
				_drawFill = value;
				triggerValidation();
			}
		}

		public function get drawFill() : Boolean {
			return _drawFill;
		}

		public function set drawLine(value : Boolean) : void {
			if (_drawLine != value) {
				_drawLine = value;
				triggerValidation();
			}
		}

		public function get drawLine() : Boolean {
			return _drawLine;
		}

		public function set color(value : uint) : void {
			if (_color != value) {
				_color = value;
				triggerValidation();
			}
		}

		public function get color() : uint {
			return _color;
		}

		public function set alpha(value : Number) : void {
			if (_alpha != value) {
				_alpha = value;
				triggerValidation();
			}
		}

		public function get alpha() : Number {
			return _alpha;
		}

		public function set lineThickness(value : uint) : void {
			if (_lineThickness != value) {
				_lineThickness = value;
				triggerValidation();
			}
		}

		public function get lineThickness() : uint {
			return _lineThickness;
		}

		public function set lineColor(value : uint) : void {
			if (_lineColor != value) {
				_lineColor = value;
				triggerValidation();
			}
		}

		public function get lineColor() : uint {
			return _lineColor;
		}

		public function set lineAlpha(value : Number) : void {
			if (_lineAlpha != value) {
				_lineAlpha = value;
				triggerValidation();
			}
		}

		public function get lineAlpha() : Number {
			return _lineAlpha;
		}

		public function set pointsList(value : Point3DList): void {
			_pointsList.removeEventListener(Event.CHANGE, triggerValidation);
			_pointsList = value;
			_pointsList.addEventListener(Event.CHANGE, triggerValidation, false, 0, true);
			triggerValidation();
		}

		public function get pointsList() : Point3DList {
			return _pointsList;
		}
	}
}
